<script setup>
  import useMain from "@/stores/modules/main";

  const mainStore = useMain()
  
  const loadingClick = () => {
    mainStore.isLoading = false
  }
</script>

<template>
  <div class="loading" @click="loadingClick"
       v-if="mainStore.isLoading">
    <div class="box">
      <img src="@/assets/img/home/full-screen-loading.gif" alt="加载">
    </div>
  </div>
</template>

<style lang="less" scoped>
  .loading {
    position: fixed;
    z-index: 999;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    .box {
      background-image: url("@/assets/img/home/loading-bg.png");
      background-size: cover;
      width: 120px;
      height: 120px;
      display: flex;
      align-items: center;
      justify-content: center;

      img {
        width: 70px;
        margin-top: -10px;
      }
    }
  }
</style>